package com.wx.jwt.service;

import com.wx.jwt.dao.UserDao;
import com.wx.jwt.po.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author wx
 * @Description: 用户业务层
 * @date 2018/11/27 002710:58
 */
@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    /**
     * @description: 新增用户
     * @author: wx
     * @date: 2018/11/27 0027
     * @param user
     * @return: void
     */
    public void save(User user) {
        if (user == null){
            return;
        }
        userDao.insert(user);

    }

    /**
     * @description: 根据用户名与密码查询用户信息
     * @author: wx
     * @date: 2018/11/27 0027
     * @param name
     * @param password
     * @return: com.wx.jwt.po.User
     */
    public User getByNameAndPassword(String name,String password){
        return userDao.getByNameAndPassword(name, password);
    }
}
